gtk_style_context_stop_animating (context);
}
+static void
+gtk_style_context_clear_parent (GtkStyleContext *context)
+{
+ GtkStyleContextPrivate *priv = context->priv;
+
+ if (priv->parent)
+ {
+ priv->parent->priv->children = g_slist_remove (priv->parent->priv->children, context);
+ g_object_unref (priv->parent);
+ }
+}
+
static void
gtk_style_context_finalize (GObject *object)
{
/* children hold a reference to us */
g_assert (priv->children == NULL);
- gtk_style_context_set_parent (style_context, NULL);
+ gtk_style_context_clear_parent (style_context);
gtk_style_context_set_cascade (style_context, NULL);
gtk_style_context_set_invalid (parent, TRUE);
}
- if (priv->parent)
- {
- priv->parent->priv->children = g_slist_remove (priv->parent->priv->children, context);
- g_object_unref (priv->parent);
- }
+ gtk_style_context_clear_parent (context);
priv->parent = parent;